{%- include utils/get-cdn.html -%} {%- assign _cdn = __return -%}
<link rel="stylesheet" href="{{ _cdn.katex.css }}" />
<script type="text/javascript" src="{{ _cdn.katex.js }}"></script>

<script>
  $("script[type='math/tex']").replaceWith(function () {
    var tex = $(this).text();
    return katex.renderToString(tex, { displayMode: false });
  });

  $("script[type='math/tex; mode=display']").replaceWith(function () {
    var tex = $(this).html();
    return katex.renderToString(tex.replace(/%.*/g, ""), { displayMode: true });
  });
</script>
